/**
 * file
 */
package com.tdkj.model.financial;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;
import com.tdkj.model.user.BeanUser;

/**
 * 
 * FileName: TradingMarket.java
 * 
 * @Description: TODO 买卖市场
 * 
 *               All rights Reserved, Designed By ZTE-ITS
 * 
 *               Copyright: Copyright(C) 2010-2011
 * 
 *               Company 天成科技有限公司
 * 
 * @author: 李兴建
 * 
 * @version V1.0
 * 
 *          Createdate: 2012-7-28 下午04:11:33
 * 
 * 
 * 
 *          Modification History:
 * 
 *          Date Author Version Discription
 * 
 * 
 * 
 * 
 * 
 * 
 *          
 *          ----------------------------------------------------------------------
 *          -------------
 * 
 *          2012-7-28 李兴建 1.0 1.0
 * 
 *          Why & What is modified: <修改原因描述>
 */
@Entity
@Table(name = "financial_trading")
public class BeanTrading extends BaseEntity {
	private static final long serialVersionUID = -6940905790239677030L;
	private BeanUser user;
	
	private BeanUser toUser;
	// 提 供
	private int provide;
	// 需 求
	private int demand;
	// 操作时间
	private Timestamp dateTime;
	// 状态 0:上市 1：成功 2：失败
	private int state;
	
	@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "user_id")
	public BeanUser getUser() {
		return user;
	}

	public void setUser(BeanUser user) {
		this.user = user;
	}
	
	@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "to_user_id")
	public BeanUser getToUser() {
		return toUser;
	}

	public void setToUser(BeanUser toUser) {
		this.toUser = toUser;
	}

	public int getProvide() {
		return provide;
	}

	public void setProvide(int provide) {
		this.provide = provide;
	}

	public int getDemand() {
		return demand;
	}

	public void setDemand(int demand) {
		this.demand = demand;
	}

	public Timestamp getDateTime() {
		return dateTime;
	}

	public void setDateTime(Timestamp dateTime) {
		this.dateTime = dateTime;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

}
